package com.dxiang.demo.web.controller;

import com.dxiang.demo.property.NeoProperty;
import com.dxiang.demo.web.dto.response.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//@RestController 的意思就是controller里面的方法都以json格式输出
@RestController
public class HelloController {


    @Autowired
    private NeoProperty property;

    @RequestMapping("/hello")
    public String index(){
        return "hello"+"    "+property.getTitle();
    }

    @RequestMapping("/getUserInfo")
    public User getUserInfo(){
        User user = new User();
        user.setName("dongxiang");
        user.setNickName("linyu");
        return user;
    }


}
